import React from "react";
import { isEmpty } from "@ct0/functions";
import type { DescriptionDefaultValueType } from "../type";

export default function DefaultItem({
  value,
  emptyValueText = "(空)",
}: {
  value: DescriptionDefaultValueType;
  emptyValueText?: React.ReactNode;
}) {
  if (isEmpty(value))
    return <span className="ct0-description-empty">{emptyValueText}</span>;
  return <span>{String(value)}</span>;
}
